package com.hmall.common.client;

import com.hmall.common.dto.Address;
import com.hmall.common.dto.Order;
import com.hmall.common.dto.OrderDetail;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

@FeignClient(value = "orderservice")
public interface OrderClient {
    @GetMapping("order/status/{id}")
    int getStatus(@PathVariable("id") Long orderId);

//    @GetMapping("order/num/{id}")
//    int getNum(@PathVariable("id") Long orderId);
    @GetMapping("order/num/{id}")
    OrderDetail getOrderDetail(@PathVariable("id") Long orderId);


    @PutMapping("order/status/{id}")
    int cancelOrder(@PathVariable("id") Long orderId);

    @GetMapping("order/{id}")
    Order queryOrderById(@PathVariable("id") Long orderId);

    @PutMapping("order/payisOk/{id}")
    int payisOk(@PathVariable("id") Long orderId);
}
